import { createRouter, createWebHistory } from "vue-router";
import Login from "../views/Login.vue";
import Layout from "../views/Layout.vue";
import UserInfo from "../views/user/UserInfo.vue";
import UserList from "../views/user/UserList.vue";
import Index from "../views/index/Index.vue";
import AppointmentView from "../views/online/AppointmentView.vue";
import HealthValuation from "../views/valuation/HealthValuation.vue";
import ConsultationManage from "../views/consultation/ConsultationManage.vue";
// 引入新创建的咨询记录页面组件
import ConsultationRecord from "../views/consultation/ConsultationRecord.vue";
import CounselorLibrary from "../views/counselor/CounselorLibrary.vue";
import CounselorDetail from "../views/counselor/CounselorDetail.vue";
import FocusCases from "../views/focusCases/FocusCases.vue";
import NewRecord from "../views/focusCases/NewRecord.vue";
import Noonline from "../views/no_online/Noonline.vue";
import Assistantset from "../views/assistant/Assistantset.vue";

import ECharts from "../views/admin/ECharts.vue";
import Arrange from "../views/user/Arrange.vue";
// 定义路由关系
const routes = [
  { path: '/login', component: Login },  // 一级路由
  {
    path: '/',
    redirect: '/login',  // 重定向
    component: Layout,
    // 子路由
    children: [
      {path: '/index', component: Index},
      {path: '/user/list', component: UserList},
      {path: '/user/info', component: UserInfo},
      {path: '/AppointmentView', component: AppointmentView},
      {path: '/HealthValuation', component: HealthValuation},
      {path: '/ConsultationManage', component: ConsultationManage },
      {path: '/noonline', component: Noonline},
      {path: '/assistantset', component: Assistantset},
      {
      path: '/consultation/manage/record/:studentId',
      component: ConsultationRecord,
      name: 'ConsultationRecord'
      },
      { path: '/counselor/library', component: CounselorLibrary },
      {
      path: '/counselor/detail/:counselorId',
      component: CounselorDetail,
      name: 'CounselorDetail'
      },
      { path: '/focusCases/Cases', component: FocusCases },
      // 添加新的路由配置
      {
      path: '/focusCases/NewRecord/:studentId',
      component: NewRecord,
      name: 'NewRecord'
      },
      {path: '/admin/echarts', component: ECharts},
      {path: '/user/arrange', component: Arrange},
    ]
  },
];
// 创建路由器
const router = createRouter({
  history: createWebHistory(), // 路由模式
  routes: routes
});

// 导出暴露
export default router;